﻿using UnityEngine;
using System.Collections;

public class sw_attack : MonoBehaviour {
    public int damage;
    public int MoveSpeed;
	// Use this for initialization
	void Start () {
	
	}
	
	// Update is called once per frame
	void Update () {
        transform.Translate(Vector3.right * Time.deltaTime * MoveSpeed);

    }
    void OnTriggerStay2D(Collider2D other) {
        other.SendMessage("TakeDamage",20);
        other.SendMessage("Backward", 1);
        other.SendMessage("set_beattacked", "wave"+Time.time);
        //other.GetComponent<health>().TakeDamage(damage);
        Destroy(this.gameObject);
    }
}
